﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Globalization;
using MvcStudy.Models;
using EntLib.Domain.Common;
using BLL;
using Entity;

namespace MvcStudy.Controllers
{
    public class DefaultController : Controller
    {
        //
        // GET: /Default/
        //[CompressFilter( IsAvailable = true),HtmlFilterNet( IsAvailable = true)]
        public ActionResult Index(int? id)
        {
            //ViewBag.Message = CommHelper.GetHtmlDocument("http://www.baidu.com/");
            #region 适合ASPX页面
            ////处理点击“转到”或者光标移入地址栏然后回车，也就是本文所阐述的
            //this.Response.AddHeader("Cache-Control", "max-age=60");
            ////这是用来处理F5刷新的，也就是对Last-Modified有效
            //this.Response.AddHeader("Last-Modified", DateTime.Now.ToString("U", DateTimeFormatInfo.InvariantInfo));
            //DateTime IfModifiedSince;
            //if (DateTime.TryParse(this.Request.Headers.Get("If-Modified-Since"), out IfModifiedSince))
            //{
            //    if ((DateTime.Now - IfModifiedSince.AddHours(8)).Seconds < 60)
            //    {
            //        Response.Status = "304 Not Modified";
            //        Response.StatusCode = 304;
            //        return;
            //    }
            //}
            #endregion

            int total = 0;
            UserRemarkBLL bll = new UserRemarkBLL();            
            var userRemark = new UserRemark() { ID = 1, UserId = 12, Remark = "123", CreateTime = DateTime.Now, OperatorId = 4, OperatorName = "llm" };
            ViewBag.Message = bll.Remove(1) ? "删除成功" : "删除失败";
            var list = bll.GetPagingList(id ?? 1, 20, out total);
            return View(list);
        }

    }
}
